package com.zxy.rabbitmqdemo;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App {
  public static void main(String[] args) {
    ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application-context.xml");
    AmqpTemplate amqpTemplate = (AmqpTemplate) applicationContext.getBean("rabbitmqDemoAmqpTemplate");
    // amqpTemplate.convertAndSend("hello");
    amqpTemplate.convertAndSend("rabbitmqDemoExchange", "rabbitmqDemoQueue1_key", "hello");
    // amqpTemplate.
  }
}
